-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Cleanup #17801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Cleanup #17801
Conversation
Signed-off-by: Tran Ngoc Nhan <[email protected]>
Signed-off-by: Tran Ngoc Nhan <[email protected]>
Signed-off-by: Tran Ngoc Nhan <[email protected]>
Signed-off-by: Tran Ngoc Nhan <[email protected]>
Signed-off-by: Tran Ngoc Nhan <[email protected]>
if (result.length() == 0) { | ||
if (result.isEmpty()) { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String result = (query == null) ? "" : artifactPattern.matcher(query).replaceFirst("");
if (result.isEmpty()) {
return null;
}
* @return | ||
* @param artifactParameterName the artifactParameterName that is removed from the | ||
* current URL. The result becomes the service url. Cannot be null and cannot be an | ||
* empty String. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot be null and cannot be an empty String -> Cannot be null or empty String
return role; | ||
} | ||
if (defaultRolePrefix == null || defaultRolePrefix.length() == 0) { | ||
if (defaultRolePrefix == null || defaultRolePrefix.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there are several uses of str == null || str.isEmpty()
I think a common util function will be helpful
boolean isEmpty(String str) {
return str == null || str.length == 0;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use !org.springframework.util.StringUtils#hasLength
Signed-off-by: Tran Ngoc Nhan <[email protected]>
Signed-off-by: Tran Ngoc Nhan <[email protected]>
ec9b7b9
to
f77e0b9
Compare
This PR includes
StringUtils#hasLength